package com.lc.demo.service.impl;

import com.lc.demo.bean.StuTestInformation;
import com.lc.demo.bean.TeaTestInformation;
import com.lc.demo.bean.deskInformation;
import com.lc.demo.bean.test;
import com.lc.demo.mapper.TestMapper;
import com.lc.demo.service.TeacherService;
import com.lc.demo.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public  class TestServiceImpl implements TestService {
    @Autowired
    private TestMapper testMapper;

    @Override
    public List<test> getAllTest(){
        return testMapper.getAllTest();
    }

    @Override
    public test SelectATest(String testId) {
        return testMapper.SelectATest(testId);
    }

    @Override
    public void UpdateATest(test test) {
         testMapper.UpdateATest(test.getTestId(),test.getCourseName(),test.getCredit(),test.getClassName(),test.getEndTime(),test.getTestDate(),test.getTestTime(),test.getTeaId());
    }

    @Override
    public void DeleteATest(String testId) {
        testMapper.DeleteATest(testId);
    }

    @Override
    public void AddATest(test test) {
        testMapper.AddATest(test.getTestId(),test.getCourseName(),test.getCredit(),test.getClassName(),test.getEndTime(),test.getTestDate(),test.getTestTime(),test.getTeaId());
    }

    @Override
    public List<test> getTestById(String testId) {
        return testMapper.getTestById(testId);
    }

    @Override
    public List<TeaTestInformation> TeaTestInformation(String teaId) {
         return testMapper.TeaTestInformation(teaId);
    }

    @Override
    public List<StuTestInformation> StuGoToTest(String stuId) {
        return testMapper.StuGoToTest(stuId);
    }

    @Override
    public List<deskInformation> GetDeskInformation(String testId) {
        return testMapper.GetDeskInformation(testId);
    }

    @Override
    public void AddDeskInformation(deskInformation deskInformation,String courseName) {
         testMapper.AddDeskInformation(deskInformation.getDeskId(),deskInformation.getStuId(),courseName);
    }

    @Override
    public List<deskInformation> SelectADesk(String deskId,String testId) {
      return  testMapper.SelectADesk(deskId,testId);
    }

    @Override
    public void deleteDeskId(String testId, String deskId) {
        testMapper.deleteDeskId(testId,deskId);
    }


}

